package model;

import java.io.Serializable;
import java.util.Date;
import java.util.UUID;

public class Ticket implements Serializable {
    private static final long serialVersionUID = 1L;
    private String id;
    private String showId;
    private String movieName;
    private String hallName;
    private Date showTime;
    private int row;
    private int col;
    private double price;
    private Date sellTime;
    private boolean isRefunded;

    public Ticket(String showId, String movieName, String hallName, Date showTime, int row, int col, double price) {
        this.id = UUID.randomUUID().toString();
        this.showId = showId;
        this.movieName = movieName;
        this.hallName = hallName;
        this.showTime = showTime;
        this.row = row;
        this.col = col;
        this.price = price;
        this.sellTime = new Date();
        this.isRefunded = false;
    }

    // Getter和Setter
    public String getId() { return id; }
    public String getShowId() { return showId; }
    public String getMovieName() { return movieName; }
    public String getHallName() { return hallName; }
    public Date getShowTime() { return showTime; }
    public int getRow() { return row; }
    public int getCol() { return col; }
    public double getPrice() { return price; }
    public Date getSellTime() { return sellTime; }
    public boolean isRefunded() { return isRefunded; }
    public void setRefunded(boolean refunded) { isRefunded = refunded; }
}